#region Namespace References

using System;
using System.Windows.Forms;
using DynConDevCorp.OpenArch.SmartData.Interfaces;
using DynConDevCorp.OpenArch.SmartData.Interfaces.UserInterface.WinForms;

#endregion

namespace DynConDevCorp.OpenArch.SmartData.Interfaces.UserInterface
{
    /// <summary>
    /// Common base for representing a UI Control (WinForms, ASP.NET, WPF, SilverLight, etc)
    /// which can be bound to a Smart Instance or Collection
    /// </summary>
    public interface ISmartControl
    {
        #region Public Instance Properties

        /// <summary>
        /// Gets or sets the bound data.
        /// </summary>
        /// <value>The bound data.</value>
        ISmartField BoundData { get; set; }

        /// <summary>
        /// Gets or sets the smart binder.
        /// </summary>
        /// <value>The smart binder.</value>
        ISmartBinder SmartBinder { get; set; }

        /// <summary>
        /// Gets as control.
        /// </summary>
        /// <value>As control.</value>
        /// <remarks>
        /// This is currently a WinForms Control, but will be generalized in a future release.
        /// </remarks>
        Control AsControl { get; }

        /// <summary>
        /// Gets or sets the name of the bound field.
        /// </summary>
        /// <value>The name of the bound field.</value>
        String BoundFieldName { get; set; }

        /// <summary>
        /// Gets or sets the control parameters.
        /// </summary>
        /// <value>The control parameters.</value>
         ISmartControlParameters ControlParameters { get; set; }

        /// <summary>
        /// Gets or sets the bound collection.
        /// </summary>
        /// <value>The bound collection.</value>
        ISmartFieldCollection BoundCollection { get; set; }

        #endregion

        #region Public Instance Methods

        /// <summary>
        /// Shows the display value.
        /// </summary>
        /// <param name="displayText">The display text.</param>
        void ShowDisplayValue(string displayText);

        #endregion
    }
}